﻿@model List<EasyMvcBlog.DTO.CategoryDTO>
@section Scripts
{
    <script type="text/javascript">
        $(function () {
            CategoryEdit();
            CategoryDelete();
        });
    </script>
}
<div class="content-box" style="height: 200px;">
    <div class="content-box-header">
        <span>新建分类</span>
    </div>
    <div class="content-box-content">
        @using (Html.BeginForm("AddNewCategoryName", "Admin"))
        {
            <table class="easyInputTable" style="width: 80%">
                <tr>
                    <td>
                        目录名字:
                    </td>
                    <td>
                        @Html.TextBox("newCategoryName", null, new { style = "width:200px" })
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <input type="submit" class="easyButton" value="创建" />
                    </td>
                </tr>
            </table>         
        }
    </div>
</div>
<div class="clear">
</div>
<div class="content-box">
    <div class="content-box-header">
        <span>已有分类</span>
    </div>
    <div class="content-box-content">
        <table class="easyShowTable" width="80%" style="margin-bottom: 20px;">
            <thead>
                <tr>
                    <th>
                        分类
                    </th>
                    <th>
                        删除
                    </th>
                </tr>
            </thead>
            @foreach (CategoryDTO category in Model)
            {
                <tr>
                    <td style="display: none;">
                        @category.Id
                    </td>
                    <td style="width: 50%">
                        <span class="categoryName" style="cursor: pointer;">@category.CategoryName</span>
                    </td>
                    <td>
                        <img style="cursor:pointer;" class="deleteCategory" src=@Url.Content("~/Themes/Green/Images/delete.png") />
                    </td>
                </tr>
            }
        </table>
    </div>
</div>
<div class="clear">
</div>
